package dian.qing.li.demo.security.constants;

import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.experimental.UtilityClass;

@UtilityClass
public final class Constants {
    /**
     * JWT密钥
     */
    public static final String JWT_SECRET = "JWT-admin1qaz!QAZ";

    /**
     * 1-是 EC_liqingdian
     */
    public static final int YES = 1;
    /**
     * 0-否 EC_liqingdian
     */
    public static final int NO = 0;

    /**
     * 树结构根节点
     *
     * @author: liqingdian
     */
    public static final String PARENT_ROOT = "0";
    /**
     * 路径分隔符
     */
    public static final String SEPARATOR_PATH = "/";

    /**
     * 删除字段
     */
    public static final String DELETE_FIELD = "deleted";

    /**
     * 角色类型-权限角色
     */
    public static final int ROLE_TYPE_AUTH = 1;
    /**
     * 角色类型-管理员角色
     */
    public static final int ROLE_TYPE_ADMIN = 2;
    /**
     * 角色类型-身份角色
     */
    public static final int ROLE_TYPE_POSITION = 3;

    /**
     * 匿名用户
     */
    public static final String ANONYMOUS_USER = "GUEST";
    /**
     * 登陆账号参数名
     */
    public static final String USERNAME_PARAMETER = "username";
    /**
     * 登陆密码参数名
     */
    public static final String PASSWORD_PARAMETER = "password";

    /**
     * 验证码唯一标识
     */
    public static final String VERIFY_CODE_HEADER = "uniquekey";
    /**
     * 验证码参数
     */
    public static final String VERIFY_CODE_PARAM = "verifyCode";
    /**
     * 验证码图片
     */
    public static final String VERIFY_CODE_IMAGE = "verifyImage";

    /**
     * fastjson序列化特性 EC_liqingdian
     */
    public static final SerializerFeature[] FASTJSON_SERIALIZER = {
            SerializerFeature.DisableCircularReferenceDetect,
            SerializerFeature.SortField,
            SerializerFeature.WriteMapNullValue,
            SerializerFeature.WriteDateUseDateFormat,
            SerializerFeature.WriteNullListAsEmpty,
            SerializerFeature.WriteNullStringAsEmpty,
            SerializerFeature.WriteBigDecimalAsPlain,
            SerializerFeature.WriteEnumUsingToString,
            SerializerFeature.SkipTransientField
    };
}
